/*
 * vim: ts=4 sw=4 fdm=marker noet tw=78 ai
 * %%LICENSE%%
 */
#include <sys/cdefs.h>
#ifdef __FBSDID
__FBSDID("$Coar$");
#endif

#include <stdio.h>

#include <err.h>

#include <lber.h>
#include <ldif.h>

#include "extern.h"
#include "lde_ldif.h"

void
lde_write_ldif(runtime_t *ctx, int type, char *name, char *val,
		ber_len_t len)
{
	char *out = NULL;

	if( (out = ldif_put_wrap(type, name, val, len, 76)) == NULL )
		warn("Failed to wrap ldif value for %s", name);
	else
	{
		fputs(out, ctx->opt_file);
		ber_memfree(out);
	}
}
